package com.mew.chess.core.game.shbz.game.message.request;

import com.zebra.common.ZebraBaseMessage;
import io.netty.buffer.ByteBuf;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;


@Data
@ToString
@NoArgsConstructor
public class SwitchCannonRequestMessage extends ZebraBaseMessage<SwitchCannonRequestMessage> {

    private int seatNo;  //推送 其他玩家需要
    private byte cannonId;  //炮台ID

    @Override
    public void write(ByteBuf b) {

        writeInt(b,seatNo);
        writeByte(b, this.cannonId);
    }

    @Override
    public SwitchCannonRequestMessage read(ByteBuf b) {
        SwitchCannonRequestMessage message = new SwitchCannonRequestMessage();
        message.seatNo = readInt(b);
        message.cannonId = readByte(b);
        return message;
    }

}
